import request from '@/utils/request'

// 查询题库：sys_question列表
export function listQuestion() {
  return request({
    url: '/system/node/question/list',
    method: 'get',

  })
}
//随机出题
export function randomQuestion(data){
  return request({
    url: '/system/graph/node/question/random',
    method: 'get',
    params:data
  })
}
//根据节点出题
export function nodeQuestion(data){
  return request({
    url: '/system/graph/node/question/id',
    method: 'get',
    params:data
  })
}

// 查询题库：sys_question详细
export function getQuestion(questionId) {
  return request({
    url: '/system/question/' + questionId,
    method: 'get'
  })
}

// 新增题库：sys_question
export function addQuestion(data) {
  return request({
    url: '/system/question',
    method: 'post',
    data: data
  })
}

// 修改题库：sys_question
export function updateQuestion(data) {
  return request({
    url: '/system/question',
    method: 'put',
    data: data
  })
}

// 删除题库：sys_question
export function delQuestion(questionId) {
  return request({
    url: '/system/question/' + questionId,
    method: 'delete'
  })
}
//题目答案提交
export function submitAnswer(data){
  return request({
    url:'/system/answer/batch',
    method:'post',
    data:data
  })
}
